home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 17432 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  2.4 KB

  1. Path: pangea.Stanford.EDU!karish
  2. From: karish@pangea.Stanford.EDU (Chuck Karish)
  3. Newsgroups: comp.lang.ada,comp.lang.c,comp.lang.c++,comp.edu
  4. Subject: Re: ANSI C and POSIX (was Re: C/C++ knocks the crap out of Ada)
  5. Date: 15 Apr 1996 20:30:38 GMT
  6. Organization: Mindcraft, Inc.
  7. Message-ID: <4kuble$35k@nntp.Stanford.EDU>
  8. References: <JSA.96Feb16135027@organon.com> <dewar.829345962@schonberg> <4knqun$ga1@nntp.Stanford.EDU> <dewar.829399701@schonberg>
  9. NNTP-Posting-Host: pangea.stanford.edu
  10.  
  11. In article <dewar.829399701@schonberg>, Robert Dewar <dewar@cs.nyu.edu> wrote:
  12. >Chuck asked (replying to me):
  13. >
  14. >">Of course GCC has a much more agressive view of portability, but it
  15. >>certainly would be nice to see more standardization here,
  16. >
  17. >I don't understand.  Do you have portability problems when you use
  18. >gcc in ANSI mode?"
  19.  
  20. >Yes we do. gcc takes the view that it should work in all common C
  21. >environments (i.e. those in use today), whether or not they are ANSI
  22. >compliant. Early on when I started writing some C runtime code for
  23. >GNAT (or more accurately interfacing to standard C runtime routines),
  24. >I followed the ANSI standard. As I mentioned before the particular
  25. >example I remember is that I used the return value of sprintf,
  26. >assuming it returned int. My code worked on several systems, and
  27. >then failed on SunOS, and I was told -- oh yes, everyone knows that
  28. >you cannot use the returned value of sprintf.  Now of course it is
  29. >the case that there must be available on SunOS a conforming library,
  30. >but we require gcc to work with all commonly used environments without
  31. >any special fiddling in choosing libraries.
  32.  
  33. While I applaud the attempt to make gcc work even with broken
  34. C libraries, I don't think it's particularly productive to
  35. describe gcc as being flawed when this turns out not to be
  36. possible.
  37.  
  38. >That's what I meant by
  39. >saying that gcc has a more strenuous view of portability. Chuck's
  40. >view of portablity seems to be "use ANSI, and too bad if it doesn't
  41. >work for you".
  42.  
  43. That's not the way I work and it's not the way I've described
  44. my approach in this thread.
  45.  
  46. >That's fair enough but it is not the attitude that
  47. >gcc takes, where we are aiming for much more general portability.
  48.  
  49. There are limits to what can be accomplished this way.  ANSI
  50. C and traditional C are different languages.
  51. --
  52.  
  53.     Chuck Karish          karish@mindcraft.com
  54.     (415) 323-9000 x117   karish@pangea.stanford.edu
  55.